from django.shortcuts import render

from .KnowledgeClinet import KnowledgeClient
from .RerankClient import RerankClient
from .EmbeddingClient import EmbeddingClient
import os
from dotenv import load_dotenv

load_dotenv()

# 初始化知识库客户端
knowledge_client = KnowledgeClient(
    persist_directory=os.path.join(os.path.dirname(__file__), "db"),
    embedding_client=EmbeddingClient(api_key=os.getenv("SILICONCLOUD_API_KEY"),
                                     # base_url=os.getenv("SILICONCLOUD_BASE_URL"),
                                     model=os.getenv("SILICONCLOUD_EMBEDDING_MODEL_NAME")
                                     ),  # 使用默认EmbeddingClient
    rerank_client=RerankClient(api_key=os.getenv("SILICONCLOUD_API_KEY"),
                               model=os.getenv("SILICONCLOUD_RARANKER_MODEL_NAME"))     # 不使用RerankClient
)



# Create your views here.
